package org.itboys.mobile.entity.mysql.order;

import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mysql.entity.BaseMySqlEntity;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 作者：jiangxiong
 * 日期：2017年5月8日
 * 联系方式 ：empty90911@126.com
 * 描述：圣代_订单_实体。如果字段不够请自行扩展。不需要继承此类！！！！！！！！！！！！
 */
public class SundayOrder extends BaseMySqlEntity {
     //基础信息
    private String orderNo;//订单编号
    private BigDecimal totalAmount;//订单金额应付(钱或积分)
    private BigDecimal payAmount;//订单金额实付(钱或积分)
    private Integer orderStatus;//订单状态
    private String receiveName;//收货人
    private String receiveMobile;//收货电话
    private String receiveAddress;//收货地址
    private Long memberId;//购买人Id;
    private String memberName;//购买人昵称
    private BigDecimal sendAmount;//配送费
    private String sendCompany;//快递公司
    private String sendCompanyCode;//快递公司编号
    private String sendCode;//运单编号
    private String remark;//订单备注
   //时间信息
    private Date sendTime;//配送时间
    private Date receiveTime;//收货时间
    //2017年7月1日 订单商品
    private List<SundayOrderProduct> products;
    public SundayOrder() {

    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getReceiveName() {
        return receiveName;
    }

    public void setReceiveName(String receiveName) {
        this.receiveName = receiveName;
    }

    public String getReceiveMobile() {
        return receiveMobile;
    }

    public void setReceiveMobile(String receiveMobile) {
        this.receiveMobile = receiveMobile;
    }

    public String getReceiveAddress() {
        return receiveAddress;
    }

    public void setReceiveAddress(String receiveAddress) {
        this.receiveAddress = receiveAddress;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public BigDecimal getSendAmount() {
        return sendAmount;
    }

    public void setSendAmount(BigDecimal sendAmount) {
        this.sendAmount = sendAmount;
    }

    public String getSendCompany() {
        return sendCompany;
    }

    public void setSendCompany(String sendCompany) {
        this.sendCompany = sendCompany;
    }

    public String getSendCompanyCode() {
        return sendCompanyCode;
    }

    public void setSendCompanyCode(String sendCompanyCode) {
        this.sendCompanyCode = sendCompanyCode;
    }

    public String getSendCode() {
        return sendCode;
    }

    public void setSendCode(String sendCode) {
        this.sendCode = sendCode;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    public List<SundayOrderProduct> getProducts() {
        return products;
    }

    public void setProducts(List<SundayOrderProduct> products) {
        this.products = products;
    }

    public String  getOrderStatusStr(){
        String orderStatusStr= "";
        if(orderStatus==null)return orderStatusStr;

        switch (orderStatus) {
            case 1:
                orderStatusStr="待付款";
                break;
            case 2:
                orderStatusStr="待配送";
                break;
            case 3:
                orderStatusStr="配送中";
                break;
            case 4:
                orderStatusStr="待评价";
                break;
            case 5:
                orderStatusStr="已评价";
                break;
            case 6:
                orderStatusStr="待退款";
                break;
            case 7:
                orderStatusStr="已退款";
                break;
            case 8:
                orderStatusStr="待退货";
                break;
            case 9:
                orderStatusStr="已退货";
                break;
            case 10:
                orderStatusStr="已取消";
                break;
            default:
                break;
        }
        return orderStatusStr;
    }


    public String getSendTimeStr(){
        if(sendTime!=null)return TimeUtils.formatToTime(sendTime);
        return null;
    }
    public String getReceiveTimeStr(){
        if(receiveTime!=null)return TimeUtils.formatToTime(receiveTime);
        return null;
    }



}


